<template>
	<view class="share">
		<!-- 使用之前需要提前配置好相关appid -->
		<view class="default" @click="on">分享</view>
		<share ref="share" :contentHeight="450" :shareList="shareList" :shareInfo="shareInfo"></share>
	</view>
</template>

<script>
	import share from '@/components/share/share.vue'
	export default{
		data(){
			return{
				shareList:[],
				shareInfo:{},// 分享的内容
			}
		},
		components:{
			share
		},
		onLoad() {
			this.shareList = this.$json.shareList  // 需要分享的按钮
			// href	链接
			// shareContent   内容
			// shareTitle  标题
			// sharePhoto   图片
			this.shareInfo.href = "www.baidu.com"
			this.shareInfo.shareContent = "www.baidu.com"
			this.shareInfo.shareTitle = "www.baidu.com"
			this.shareInfo.sharePhoto = "www.baidu.com"
		},
		methods:{
			on(){
				this.$refs.share.toggleMask();
			}
		}
	}
</script>

<style>
	.default{
		background: #976BF8;
		border-radius: 20rpx;
		height: 70rpx;
		line-height:  70rpx;
		width: 90%;
		display: block;
		text-align: center;
		color: #FFFFFF;
		margin: auto;
	}
</style>
